## returns the item at the specified index
## the index is normalized (see list_normalize_index)
function(list_get __list_get_lst idx)
  list_normalize_index("${__list_get_lst}" "${idx}")
  ans(index)
  list_length("${__list_get_lst}")
  ans(len)
  if("${index}" LESS 0 OR "${index}" GREATER "${len}")
    return()
  endif()
  list(GET ${__list_get_lst} "${index}" value)
  return_ref(value)
endfunction()